The present invention relates to an image encoding method and apparatus thereof. Specifically with relation to an image encoding apparatus comprising of a code amount control circuit which makes both an orthogonal transformation and a variable-length encoding of the entered image signals.
In general, the conventional image encoding apparatus utilizes an orthogonal transformation and variable-length encoding process. The image encoding apparatus makes an orthogonal transformation of the entered image signals, causing a polarization of the transformed coefficients. It then assigns short code words to the transformed coefficients with high occurrence probabilities, and long code words to those with low occurrence probabilities, compressing the entire code amount. This enables high efficient encoding. The image encoding apparatus needs a code amount control circuit to encode the entered image with different information contents and different characteristics, using a given amount of codes.
Code amount control circuits utilizing conventional technologies need to control the code amount within a given time, when it encodes dynamic images in real time. Thus, it makes use of a method with the combination of a feedforward and feedback control approaches.
It is well-known that with the feedforward control approach through both quantizing and variable-length encoding DCT coefficients in advance, control of the code amount can be most accurately made to analyze the characteristics of both the entered images and the variable-length code words to be utilized for encoding. However, it is difficult, to develop small-sized apparatus due to the large scale circuits to a variable-length encode. Thus, the control is made utilizing a correlation of neighboring pixels in the entered image and/or the sum of the absolute values of the DCT coefficients, realizing smaller-sized circuits with lower predictive accuracy. Such control with the sum of the absolute values of DCT coefficients accords the variable-length encoding operation in which a short code word will be assigned to a low transformed coefficient with a high occurrence frequency, while a long code word will be assigned to a high transformed coefficient with a low occurrence frequency.
With the feedback control approach, a quantization step value is decreased for the image encoded with less than a given code amount reference so as also to decrease corresponding quantization step size, allowing for reducing the number of quantization coefficients to be discarded. Conversely, the quantization step value is increased for the image encoded with not less than the code amount reference so as also to increase the quantization step size, allowing to increase the number of quantization coefficients to be discarded.
However, with the aforementioned conventional feedforward approach, prediction of the referential quantization step value, which will be used to encode the entered image in a vicinity of the code amount reference, is hard to be made. Moreover, the occurrence of a local image quality degrading may be easily recognized when the image is processed with several quantization step values; thus it is necessary to take into consideration the characteristics of the image. This kind of problem occurs due to the fact that the relation between the sum of the absolute values of DCT coefficients and the generated code amount is not linear. The relation also largely depends on the characteristics of the image.
As described earlier, the image encoding apparatus, which controls the entire code amount, in accordance with both the sum of the absolute values of DCT coefficients calculated with a conventional approach, and a cumulative code amount output from the variable-length encoding unit, has difficulty in making a prediction of the referential quantization step value in the vicinity of a code amount reference. In addition, the occurrence of degrading image quality may be seen as a defect in the beginning period of the image encoding process. Particularly, for an entered image with different characteristics, a partial degradation of the image quality may be easily be recognized in a level image block but a complex image block, when quantization operation is performed with a same quantization step value for both the level and complex image blocks. This may cause for missing information in the low frequency bands of transformed coefficients, this can be attributed to the fact that the human eye is not good at visually recognizing a degrading image easily within complex image portions, while good at doing so within level image portions.
Accordingly, the objective of the present invention is to provide an image encoding method and apparatus thereof which will effectively encode an image at a low price. Particularly, a prospective greatly compressed (encoded) image region where degrading image quality may be easily recognized, into an encoded image in not more than a given code amount reference, and also generating a reproduced image of high quality.
According to an aspect of the present invention, the foregoing objectives are attained by generating a quantization step value for the spatial frequency-domain coefficients in each macroblock in an image frame, dependent upon at least a code amount reference, a macroblock absolute values sum, and a frame absolute values sum; quantizing the spatial frequency-domain coefficients for a macroblock in accordance with at least the quantization step value; and variable-length encoding the quantized spatial frequency-domain coefficients into encoded data. An example processing structure to realize the previous operation will be shown as a feedforward control system in FIGS. 1 and 2.
According to another aspect of the present invention, the foregoing objectives are attained by generating a quantization step value for the spacial frequency-domain coefficients in each macroblock in an image frame, dependent upon at least a code amount reference, a slice absolute values sum, and a frame absolute values sum; quantizing the spatial frequency-domain coefficients for a macroblock in accordance with at least the quantization step value; and variable-length encoding the quantized spacial frequency-domain coefficients into encoded data. An example processing structure to realize the previous operation will be shown as a feedforward control system in FIGS. 1 and 7.
According to yet another aspect of the present invention, the foregoing objectives are attained by generating a quantization step value for the spatial frequency-domain coefficients in each macroblock in an image frame, dependent upon at least a code amount reference, a macroblock absolute values sum, a slice absolute values sum, and a frame absolute values sum; quantizing the spatial frequency-domain coefficients for a macroblock in accordance with at least the quantization step value; and variable-length encoding the quantized spacial frequency-domain coefficients into encoded data. An example processing structure to realize the previous operation will be shown as a feedforward control system in FIGS. 1 and 8.
According to yet another aspect of the present invention, the foregoing objectives are attained by generating a quantization step value for the spatial frequency-domain coefficients in each macroblock in an image frame, dependent upon at least a code amount reference, a macroblock absolute values sum, a frame absolute values sum, and the latest code amount; quantizing the spatial frequency-domain coefficients for a macroblock in accordance with at least the quantization step value; and variable-length encoding the quantized spacial frequency-domain coefficients into encoded data, and accumulates an amount of the encoded data into the latest code amount. An example processing structure to realize the previous operation will be shown as a feedforward and feedback control systems in FIGS. 1 and 2.
According to yet another aspect of the present invention, the foregoing objectives are attained by generating a quantization step value for the spatial frequency-domain coefficients in each macroblock in an image frame, dependent upon at least a code amount reference, a slice absolute values sum, a frame absolute values sum, and the latest code amount output from a variable-length encoding means; quantizing the spatial frequency-domain coefficients for a macroblock in accordance with at least the quantization step value; and variable-length encoding the quantized spacial frequency-domain coefficients into encoded data, and accumulates an amount of the encoded data into the latest code amount. An example processing structure to realize the previous operation will be shown as a feedforward and feedback control systems in FIGS. 1 and 7.
According to yet another aspect of the present invention, the foregoing objectives are attained by generating a quantization step value for the spatial frequency-domain in each macroblock in an image frame, dependent upon at least a code amount reference, a macroblock absolute values sum, a slice absolute values sum, a frame absolute values sum, and the latest code amount; quantizing the spatial frequency-domain coefficients for a macroblock in accordance with at least the quantization step value; and variable-length encoding the quantized spacial frequency-domain coefficients into encoded data, and accumulates an amount of the encoded data into the latest code amount. An example processing structure to realize the previous operation will be shown as a feedforward and feedback control systems in FIGS. 1 and 8.
According to yet another aspect of the present invention, the foregoing objectives are attained by: block partitioning means (1) for partitioning entered image signals (100) into small blocks, each made up of a plurality of pixels; orthogonal transformation means (2) for making an orthogonal transformation of each of the small blocks; quantization means (5) for quantizing orthogonally transformed coefficients (102); code amount control means for calculating a quantization step value (105) for each macroblock made up of a plurality of blocks, which will be used by the quantization means (5); variable-length encoding means (6) for variable-length encoding the quantized, transformed coefficients (108), utilizing the run-length coding method or the Huffman coding method; and then outputting them as encoded data (109) corresponding to the image signals (100). An example processing structure to realize the previous operation will be shown as a feedforward and feedback control systems in FIG. 1.